package com.github.McPlugin.util;


import com.comphenix.protocol.utility.StreamSerializer;
import org.bukkit.inventory.ItemStack;

import java.io.IOException;

public class SavaItemStack {

    public static ItemStack getItemStack(String data){
        StreamSerializer ss = new StreamSerializer();
        try{
            return ss.deserializeItemStack(data);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static String getString(ItemStack itemStack){

        StreamSerializer streamSerializer = new StreamSerializer();
        try{
            return streamSerializer.serializeItemStack(itemStack);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

}
